/*
 * Copyright (c) United Binary LLC.  All rights reserved.
 * 
 * This code is licensed under the MIT License
 * 
 * SEE: http://harnessit.codeplex.com/license
 * 
 */
using System;
using System.ComponentModel;

namespace UnitedBinary.UnitTests.Framework.TestItems
{
	/// <include file='comments.xml' path='Docs/TestResult/Class/*'/>
	[Serializable]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public class TestResult : TestObject
	{
		#region Member Variable
		// Stores the test description.
		private string testDesc = "";
		// Stores the test success or lack thereof.
		private bool testSuccess = false;
		#endregion

		#region Construction
		/// <include file='comments.xml' path='Docs/TestResult/ctor_bool_string/*'/>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public TestResult(bool testExpression, string testDescription)
		{
			if (testDescription == null)
			{
				testDescription = "";
			}

			testSuccess		= testExpression;
			testDesc		= testDescription;
		}
		#endregion

		#region Data Access Properties
		/// <include file='comments.xml' path='Docs/TestResult/Description/*'/>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public string Description
		{
			get
			{
				return testDesc;
			}
		}

		/// <include file='comments.xml' path='Docs/TestResult/Success/*'/>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public bool Success
		{
			get
			{
				return testSuccess;
			}
		}

		/// <include file='comments.xml' path='Docs/TestResult/TestObjectType/*'/>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override TestObjectTypes TestObjectType 
		{
			get
			{
				return TestObjectTypes.TestResult;
			}
		}
		#endregion
	}
}
